package com.oglvip.business.remote.service.entity;

import lombok.Data;

/**
 * @auther hanchao
 * @date 2017/1/4 22:08
 */
@Data
public class Delivery {
    private Integer storeId;
    private Integer deliveryType;
    private Integer deliveryPrice;
    private Integer startDeliveryPrice;
    private Integer freeShip;
    private Integer deliveryDistance;

    /**
     * 单位换算
     * @return
     */
    public Delivery transferDelivery(){
        if(this.getDeliveryPrice() != null){
            this.setDeliveryPrice(this.getDeliveryPrice() / 100);
        }
        if(this.getStartDeliveryPrice() != null){
            this.setStartDeliveryPrice(this.getStartDeliveryPrice() / 100);
        }
        if(this.getFreeShip() != null){
            this.setFreeShip(this.getFreeShip() / 100);
        }
        return this;
    }
}
